
// import { selfI18n } from '../../i18n';
// import { showSuccess } from '../../util/MessageDeal';
export function getStatusData () {
    // const $t = selfI18n;
    // 故障维修状态
    const checkorderstatus = [
        {
            value: '1',
            label: '处理中',
            text: '处理中'
        },
        {
            value: '2',
            label: '待验收',
            text: '待验收'
        },
        {
            value: '3',
            label: '已完成',
            text: '已完成'
        }
    ];
    const maintaincheckpercent = [
        {
            text: '1',
            label: 'a_processing',
            name: '处理中',
            value: 1
        },
        {
            text: '2',
            label: 'b_waitaccept',
            name: '待验收',
            value: 2
        },
        {
            text: '3',
            label: 'c_completed',
            name: '已完成',
            value: 3
        }
    ];
    // 获取维检工单状态对应的进度值
    const formatemaintaincheckpercent = (val) => {
        const data = maintaincheckpercent.find((item) => val === item.label);
        if (data === undefined) {
            return '0';
        } else {
            return `${data.value / 3 * 100}`;
        }
        // console.log(data);
    };
    // 获取维检工单状态value
    const getcheckvalue = (val) => {
        const data = maintaincheckpercent.find((item) => val === item.label);
        // console.log(data);
        if (data === undefined) {
            return 0;
        } else {
            return data.value;
        }
    };
    // 获取维检工单状态值
    const backcheckpercent = (val, percent) => {
        const data = maintaincheckpercent.find((item) => val === item.label);
        // console.log(data);
        if (data === undefined) {
            return '0';
        } else {
            return data.text;
        }
    };
    // 获取维检工单的name
    const getcheckname = (val) => {
        const data = maintaincheckpercent.find((item) => val === item.label);
        // console.log(data);
        if (data === undefined) {
            return '0';
        } else {
            return data.name;
        }
    };

    return {
        maintaincheckpercent,
        formatemaintaincheckpercent,
        backcheckpercent,
        getcheckvalue,
        getcheckname,
        checkorderstatus

    };
}
